const CopyWebpackPlugin = require('copy-webpack-plugin');
const proxyOption = {
    target: 'http://localhost:8080',
    changeOrigin: true
}
module.exports = {
    devServer: {
        port: 80,
        proxy: {
            "/api": proxyOption,
            "/management": proxyOption,
            "/swagger-resources": proxyOption,
            "/auth": proxyOption,
            "/v2/api-docs": proxyOption,
            "/h2-console": proxyOption
        }
    },
    configureWebpack: {
        plugins: [
            new CopyWebpackPlugin([
                { from: './node_modules/swagger-ui/dist/css', to: 'swagger-ui/dist/css' },
                { from: './node_modules/swagger-ui/dist/lib', to: 'swagger-ui/dist/lib' },
                { from: './node_modules/swagger-ui/dist/swagger-ui.min.js', to: 'swagger-ui/dist/swagger-ui.min.js' }
            ])
        ]
    }
}